using System;
using System.Collections;
using System.Collections.Generic;
using System.Text;

namespace Sedna.Util
{
    public class EqualsComparer : IEqualityComparer
    {
        bool IEqualityComparer.Equals(object x, object y)
        {
            // If both are null, or both are same instance, return true.
            if (ReferenceEquals(x, y))
            {
                return true;
            }

            if (x == null || y == null)
            {
                return false;
            }

            return x.Equals(y);
        }

        int IEqualityComparer.GetHashCode(object obj)
        {
            return obj.GetHashCode();
        }
    }
}
